1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method for dividing image data into a plurality of band areas and performing local image processing for each band area.
2. Description of the Related Art
Ordinarily local (neighborhood) image processing, such as spatial filtering, is performed on image data, when performing image forming based on digital image data. This local image processing is image processing in which some calculation is performed using all pixels included in a spatial filtering area that includes a pixel to be processed (referred to below as a pixel of interest).
As shown in FIG. 3, the local image processing, for example, is performed as successive processing in band units. Here, an example is described in which spatial filtering such as edge enhancement processing or blur processing is performed on the image data. Technology is known in which, for example as shown in FIG. 3, when performing spatial filtering on digital image data 300, the digital image data is divided into areas, and the local image processing is performed for each individual area (for example, see U.S. Pat. No. 6,587,158). In this technology, as indicated by reference numerals 301 to 304 in the upper portion of FIG. 3, the whole of one item of digital image data is divided into strips (rectangular strips) in a sub-scanning direction when reading (or when outputting) that digital image data, and various image processing is performed successively for each divided area. Below, the areas of these respective divided strips are referred to as band areas, a storage area where the band areas are developed is referred to as a band memory, an action of dividing an image is referred to as band division, and image processing performed on a band area is referred to as band processing. The band memory may be secured in any storage area of a system, but in the description given here, the band memory is secured within a main memory in order to simplify the description.
Following is a further description of ordinary band processing. First, a first band area 301 is developed in the band memory in the main memory, and image processing is performed. Next, a second band area 302 is developed by overwriting the band memory where the first band area 301 was developed, and image processing is performed. Further, a third band area 303 is developed by overwriting the band memory where the second band area 302 was developed, and image processing is performed. Finally, a fourth band area 304 is developed by overwriting the band memory where the third band area 303 was developed, and image processing is performed. As is seen from FIG. 3, the size in the longer side direction (length) is the width in the main scanning direction and therefore is the same for each of the band areas 301 to 304, but the size in the shorter side direction (height) is not necessarily the same for each of the band areas 301 to 304. In the example shown in FIG. 3, the first to third band areas 301 to 303 have the same height, but the fourth band area 304 is a portion of the entire digital image data that was not assigned to the first to third band areas, and therefore ordinarily does not have the same height as the other band areas. Consequently, the size of the storage area secured as the band memory in the main memory is determined according to the band area that has the largest size in the height direction (in the case of FIG. 3, the first to third band areas 301 to 303).
In the conventional local image processing described above, processing with reference to neighbor pixels of the pixel of interest is performed for the pixel of interest. Accordingly, in order to reliably perform image processing without a gap between band areas, a configuration is devised where portions of the band areas overlap each other on a border between band areas that are adjacent to each other.
Also, as shown in the lower portion of FIG. 3, each band area is expressed with a size of length direction×height direction, with the length direction being the longer side direction of the band area and the height direction being the shorter side direction. In this case, the length of the band areas 301 to 304 is the width in the main scanning direction of the digital image data, and the band height (height of the band area) is an arbitrary value.
Scanning of pixels in each band area can be controlled such that the scanning is performed in the height direction of the band area and not in the length direction. By performing scanning in the height direction, it is possible to prescribe the capacity of a delay memory that holds processed pixels necessary for local image processing at the size of a height that is less than the length of the respective band areas, and thus memory saving can be realized (for example, see Japanese Patent Laid-Open No. 2006-139606).
In the case of using both band processing and the above-described conventional local image processing such as spatial filtering, there also exist many types of local image processing that are not applicable merely by causing band areas to overlap. One example of such local image processing is error diffusion. Error diffusion is processing for converting multi-tone digital image data to digital image data of fewer tones, such as binary digital image data, and is one type of digital halftoning processing. Specifically, a pixel of interest is quantized to a quantization representative value based on a threshold, a quantization error that occurred at that time is diffused to tone values of neighbor pixels of the pixel of interest, the quantization error being the difference between the pixel of interest and the quantization representative value that occurred when performing quantization, and the respective tone values of these neighbor pixels are successively converted to digital halftoning data.
Thus, a feature of error diffusion is propagating the quantization error to the neighbor pixels, but when using both the above-described band processing and error diffusion, the quantization error is not correctly propagated at the band border, and so discontinuous deteriorated image quality unintentionally occurs in the digital halftoning data after error diffusion. Also, with error diffusion, a phenomenon called “sweep out” occurs in which dots are not formed until a quantization error is sufficiently accumulated. This “sweep out” is likely to occur at a band border, so that a problem also occurs in which a gap where a dot is not formed is visible as a discontinuous line or the like.
Here, with reference to FIG. 10, a description is given of an example of a problem that occurs when using both error diffusion and band processing. A case is considered in which after performing error diffusion in a band area 1000, error diffusion is performed in a band area 1010. As a result, sweep out occurs at the border between the band area 1000 and the band area 1010, so as indicated by the single-dotted chained line on the right side in FIG. 10, a gap where dots are not generated, unintentionally occurs continuously in the horizontal direction.
Also, in order to realize higher image quality in an image processing apparatus, recently there have been advances regarding increased colors and increased resolution of data to be processed, with a corresponding increase in the amount of data processed in image processing. There is naturally a desire to process this increased amount of data with as little cost as possible, and for example, there are demands to suppress the volume of memory used.